<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>opacity透明度</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        div {
            width: 200px;
            height: 200px;
            border:1px solid #ccc;
            background-color: blue;
            margin: 100px auto;
            color: white;
            /* 通过 opacity, 如果设置父元素，那么父元素中的所有子元素也会透明  */
            opacity: 0.5;
        }
    </style>
</head>
<body>
    <div>这是内容</div>
</body>
</html>